<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Controller
 *
 * @author peerawatj20
 */
class MY_Controller extends CI_Controller {

    //put your code here
    protected $data;

    public function __construct() {
        parent::__construct();

        //Check Format OS If it's a mobile. It'll show text Coming Soon 
        new Config_mobile($this);

        //Get Value Data of Config_header to set value in this class
        $config_header = new Config_header();
        $this->data = $config_header->data;

        
        //Check session for go to some URL
        $is_session = FALSE;
        if ($this instanceof Portal || $this instanceof Signin) {
            $is_session = TRUE;
        }

        if ($is_session === FALSE) {
            $logged_in = $this->session->userdata('logged_in');
            if ($logged_in !== TRUE) {
                redirect('portal');
                exit();
            }
        }
    }

}
